package com.csdj.common;

import java.util.HashMap;
import java.util.Map;

public class WebResult {
    private int code;
    private String msg;
    private Map<String,Object> result=new HashMap<>();
    //无参构造
    public WebResult() {
    }

    public WebResult(int code) {
        this.code = code;
    }
    public WebResult(int code,Object data){
        this.code=code;
        this.result.put("data",data);
    }
    public WebResult putData(String key,Object data){
        this.result.put(key,data);
        //返回当前对象
        return  this;
    }
    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Map<String, Object> getResult() {
        return result;
    }

    public void setResult(Map<String, Object> result) {
        this.result = result;
    }
}